<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../static/admin/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="../../../static/admin/css/admin.css" />
		<link rel="stylesheet" type="text/css" href="../../../layui/css/modules/laydate/default/laydate.css" />
		<script type="text/javascript" src="../../../layui/lay/modules/jquery.js"></script>
		<script type="text/javascript" src="../../../layui/lay/modules/laydate.js"></script>
		
	</head>
	<body>
<form class="layui-form" action="">
 <div class="layui-form-item proSelect">
   <label class="layui-form-label">产品类别</label>
   <div class="layui-input-block editWidth">
    <select name="productList" lay-verify="required" id="zcySelect">
     <option value=""></option>
     <option value="0">轻松融</option>
     <option value="1">容易融</option>
     <option value="2">快乐融</option>
    </select>
   </div>
  </div>
  <button class="layui-btn layui-btn-small" id="" onclick="addProductClassify()">增加产品类别</button>
</form>
<!--弹窗内容-->
<div id="select_prod" class="layui-form" hidden="hidden">
 <div class="layui-input-inline">
  <input type="text" name="text" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
 </div>
</div>


		<script src="../../../static/admin/js/jQuery-v3.3.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script>
//重新渲染表单
function renderForm(){
 layui.use('form', function(){
 var form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
 form.render();
 });
 }
//增加产品类别按钮点击事件
function addProductClassify(){

   //获取input输入的值
   var ivalue="1";
    layer.msg("输入的产品类别是："+ivalue);
    //为select添加option
    $("#zcySelect").append("<option value="+sIndex+">"+ivalue+"</option>"); 
    renderForm();//表单重新渲染，要不然添加完显示不出来新的option
    layer.close(index);
   $(layero).find("input").val('');
}

</script>

</body>

</html>